{% extends "base.html" %}

{% block body %}
<div class="aeTop">
  <span><a href="/">all</a></span>
  {% for cat in cats %}
  <span><a href="/c/{{ cat['name'] }}/">{{ cat['name'] }}</a></span>
  {% end %}
</div>
<div class="sePosts">

  <div class="aeSide">
	<ul class="info">
	  <li><label>Author</label></li>
	  <li><img src="/static/avatar_100.jpg" alt="avatar" /></li>
	  <li><label>About me</label></li>
	  <li><pre class="aboutme" style="">{{ profile }}</pre></li>
	</ul>
	<div class="hr"></div>
	<ul class="info thumb">
	  <li class="title"><label>Album</label></li>
	  <li>
		{% for img in images %}
		{% if img %}
		<a href="/static/upload/normal/{{ img['dstname'] }}"><img src="/static/upload/thumb/{{ img['dstname'] }}" alt="{{ img['rawname'] }}" title="{{ img['caption'] }}" class="img"/></a>
		{% end %}
		{% end %}
	  </li>
	</ul>
	<div class="hr"></div>
	<ul class="info">
	  <li class="title"><label>Links</label></li>
	  {% for l in links %}
	  <li>
		 <span class="link" > - <a href="http://{{ l['val'] }}" title="{{ l['comment'] }}" target="_blank">{{ l['key'] }}</a></span> -
	  </li>
	  {% end %}
	</ul>
  </div>
  
  <div class="aePosts clearfix">
	{% for post in posts['rowset'] %}
	<article>
	  <div class="date">
		<div class="year">
		  {{ re.split(r"\s+",post['ctime'].ctime())[4] }}
		</div>
		<div class="day">
		  {{ re.split(r"\s+",post['ctime'].ctime())[1] }} {{ re.split(r"\s+",post['ctime'].ctime())[2] }}
		</div>
		<div class="time">
		  {{ re.split(r"\s+",post['ctime'].ctime())[3] }}
		</div>
	  </div>
	  <div class="title">
		{% if post['top'] %} * {% end %} <a href="/t/{{ post['title'] }}.html">{{ post['title'] }}</a>
	  </div>
	  <div class="content">
		<div class="thumb">
		{% for img in post['extra'] %}
		{% if img %}
		<a href="/static/upload/postfiles/{{ img }}"><img src="/static/upload/postfiles/thumb_{{ img }}" /></a>
		{% end %}
		{% end %}
		</div>
		<pre>{{ post['excerpt'] or post['content'][:400] }}......</pre>
	  </div>
	</article>
	{% end %}
	<div class="sePosts">
	  {{ modules.Page(posts) }}
	</div>
  </div>
</div>

{% end %}

